/**
 * 功能描述
 * 服务器交互
 */

define(function (require, exports, module) {
    var aw = require("ajaxwrapper");
    var store = require("store");
	
    module.exports = {
    	queryMemberByCard:function(cardId,callback){
    		aw.ajax({
				url :"api/cate/travelaccount/querycustomerattendantinfo",
				data : {
					//"roomPersonalInfo.consumeCard.cardNumber":cardId,   加入员工的情况
					"cardId" : cardId,
					"fetchProperties":"*,status.*,roomPersonalInfo.personalInfo.name," +
							"roomPersonalInfo.personalInfo.pkPersonalInfo," +
							"roomPersonalInfo.consumeCard.status.*,"+
							"attendant.*,attendant.personalInfo.name,attendant.personalInfo.pkPersonalInfo" 
				},
				success : function(data){
					callback(data);
				}
			});
    	},
    	queryMemberById:function(idNum,callback){
    		aw.ajax({
				url :"api/member/query",
				data : {
					"personalInfo.idNumber":idNum,
					"organization.pkOrganization":store.get("user").organization.pkOrganization,
					"fetchProperties":"*,personalInfo.name",
					validatePrivilege:false,
				},
				success : function(data){
					callback(data);
				}
			});
    	},
    	createPreOrder:function(cartData,callback,errorCallBack){
    		aw.ajax({
				url :"api/cate/mealrecord/orderdishes",
				type : "POST",
				data : aw.customParam(cartData),
				success : function(data){
					callback(data);
				},
				error : function(data){
					errorCallBack(data);
				}
			});
    	},
    	userMe:function(){
    		aw.ajax({
				url :"api/user/me",
				data : {
					
				},
				success : function(data){
					
				}
			});
    	}
    };
});
